<template>
  <div>
   <!-- 面包屑导航 -->
   <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/home' }">
        <i class="el-icon-s-home"></i>
        首页
      </el-breadcrumb-item>
      <el-breadcrumb-item :to="{ path: '/shop/list' }">
        <i class="el-icon-present"></i> 
        商品管理
      </el-breadcrumb-item>
      <!-- 当前 -->
      <el-breadcrumb-item>品牌管理</el-breadcrumb-item>
    </el-breadcrumb>

   <div id="rt">
    <div style="width:100%;height:80px;">
      <el-button  icon="el-icon-plus" style="width:150px;height:40px;" @click="jia" >添加图片</el-button>
      <el-button  icon="el-icon-delete" style="width:150px;height:40px;margin-left: 10px;">批量删除</el-button>
    </div>
     <el-table
      ref="multipleTable"
      :data="list"
      tooltip-effect="dark"
      style="width: 80%;margin:50px auto;">
      <el-table-column
        type="selection"
        align="center"
        width="55">
      </el-table-column>
      <el-table-column
        align="center"
        prop="name"
        label="品牌名"
        width="200">
      </el-table-column>
      <el-table-column
        align="center"
        label="logo图片"
        width="200">
        <template slot-scope="scope">
          <img style="width:30px;height:40px" :src="scope.row.img" alt="">
        </template>
      </el-table-column>
      <el-table-column
        align="center"
        prop="px"
        label="排序"
        width="200">
      </el-table-column>
      <el-table-column
        align="center"
        prop="zs"
        label="是否展示在首页"
        width="200">
      </el-table-column>
      <el-table-column
        align="center"
        label="操作"
        width="260">
        <template slot-scope="scope">
          <span>查看详情</span>&nbsp;&nbsp;
          <i class="el-icon-edit"  @click="xiangqing(scope.row.id)"></i>&nbsp;&nbsp;
          <i class="el-icon-delete" @click="shan(scope.row.id)"></i>
        </template>
      </el-table-column>
      
    </el-table>



    </div>

  </div>
</template>
<script>
import { deletezwyLogoListtDel, getzwyLogoList } from '@/utils/api'
export default{
  data(){
    return {
      list:[]
    }
  },
  methods:{
    jia(){
      this.$router.push('/shop/brandadd/0')
    },
    xiangqing(e){
       this.$router.push('/shop/brandadd/'+e)
    },
    shan(e){
       deletezwyLogoListtDel(e).then(res=>console.log(res))
       this.$forceUpdate()
    }
  },
  created(){
    getzwyLogoList().then(res=>this.list=res.data.data)
  }
}
</script>
<style scoped>
#rt{
  width: 100%;
  height: 100%;
  margin-top: 30px;
}
</style>